<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta name="author" content="中文Lee 360811363@qq.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../css/public.css" media="all">
    <!--
    * [LupMisNotAllowedSync]
    * 本代码为系统自动生成代码，请根据自己业务进行修改;
    * 生成时间 2022-02-15 18:29:17;
    * 版权所有 2020-2022 lizhongwen，并保留所有权利;
    * 说明: 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用；不允许对程序代码以任何形式任何目的的再发布;
    * 作者: 中文Lee;
    * 作者主页: http://www.lizhongwen.com;
    * 邮箱: 360811363@qq.com;
    * QQ: 360811363;
    -->
    <style>
        .layui-code {
            min-height: 300px;
        }
    </style>
</head>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <canvas id="mom" style="background-image: linear-gradient(#000,green,#000);width: 100%;overflow: hidden;"></canvas>
            <div class="layui-tab layui-tab-brief" style="display: none;">
                <ul class="layui-tab-title">
                    <li class="layui-this">Controller.php</li>
                    <li>Service.php</li>
                    <li>ServiceImpl.php</li>
                    <li>Mapper.php</li>
                    <li>Mapper.xml</li>
                    <li>index.html</li>
                    <li>add.html</li>
                    <li>edit.html</li>
                </ul>
                <div class="layui-tab-content" style="overflow-y: auto;">

                    <!--Controller.java start  -->
                    <div class="layui-tab-item layui-show">
                        <pre class="layui-code" id="controller" lay-title="Controller.php" lay-height="" lay-skin="notepad" lay-encode="true">
                        </pre>
                    </div>
                    <!--Controller.java end  -->

                    <!--service.java start  -->
                    <div class="layui-tab-item">
                        <pre class="layui-code" id="service" lay-title="Service.php" lay-height="" lay-skin="notepad" lay-encode="true">
                        </pre>
                    </div>
                    <!--service.java end  -->

                    <!--serviceImpl.java start  -->
                    <div class="layui-tab-item">
                        <pre class="layui-code" id="service_impl" lay-title="ServiceImpl.php" lay-height="" lay-skin="notepad" lay-encode="true">
                        </pre>
                    </div>
                    <!--serviceImpl.java end  -->

                    <!--mapper.java start  -->
                    <div class="layui-tab-item">
                        <pre class="layui-code" id="mapper" lay-title="Mapper.php" lay-height="" lay-skin="notepad" lay-encode="true">
                        </pre>
                    </div>
                    <!--mapper.java end  -->

                    <!--Mapper.xml start  -->
                    <div class="layui-tab-item">
                        <pre class="layui-code" id="xml" lay-title="Mapper.xml" lay-height="" lay-skin="notepad" lay-encode="true">
                        </pre>
                    </div>
                    <!--Mapper.xml end  -->

                    <!--index.html start  -->
                    <div class="layui-tab-item">
                        <pre class="layui-code" id="index" lay-title="index.html" lay-height="" lay-skin="notepad" lay-encode="true">
                        </pre>
                    </div>
                    <!--index.html end  -->

                    <!--add.html start  -->
                    <div class="layui-tab-item">
                        <pre class="layui-code" id="add" lay-title="add.html" lay-height="" lay-skin="notepad" lay-encode="true">
                        </pre>
                    </div>
                    <!--add.html end  -->

                    <!--edit.html start  -->
                    <div class="layui-tab-item">
                        <pre class="layui-code" id="edit" lay-title="edit.html" lay-height="" lay-skin="notepad" lay-encode="true">
                        
                        </pre>
                    </div>
                    <!--edit.html end  -->
                </div>
            </div>




        </div>
    </div>

    <script src="../../../js/run.js"></script>
    <script type="text/javascript">
        $init(function() {
            $(".layui-tab-content").height($(window).height() - 100 + "px");
            //加载代码雨
            //获取画布对象
            var canvas = document.getElementById("mom");
            //获取画布的上下文
            //getContext() 方法返回一个用于在画布上绘图的环境。
            var context = canvas.getContext("2d");
            //获取浏览器屏幕的宽度和高度
            var W = window.innerWidth;
            var H = window.innerHeight;
            //设置canvas的宽度和高度
            canvas.width = W;
            canvas.height = H;
            //每个文字的字体大小
            var fontSize = 16;
            //计算列
            var colunms = Math.floor(W / fontSize);
            //记录每列文字的y轴坐标
            var drops = [];
            //给每一个文字初始化一个起始点的位置
            //计算每一个文字所谓坐标 存储y轴的坐标
            for (var i = 0; i < colunms; i++) {
                drops[i] = 1;
            }
            //运动的文字JavaScript function(){}
            var str = "0101";
            //4:fillText(str,x,y);原理就是去更改y的坐标位置
            //绘画的函数
            function draw() {
                context.fillStyle = "rgba(0,0,0,0.05)";
                //fillRect() 方法绘制“已填色”的矩形。默认的填充颜色是黑色。
                context.fillRect(0, 0, W, H);
                //给字体设置样式
                context.font = "700 " + fontSize + "px  微软雅黑";
                //给字体添加颜色
                context.fillStyle = "#00cc33"; //可以rgb,hsl, 标准色，十六进制颜色
                //写入画布中
                for (var i = 0; i < colunms; i++) {
                    var index = Math.floor(Math.random() * str.length); //设置文字出发时间随机 Math.floor(Math.random()*str.length)让数组里面的文字索引随机出现
                    var x = i * fontSize;
                    var y = drops[i] * fontSize; //也让y轴方向也向下掉一个文字的距离
                    context.fillText(str[index], x, y);
                    // //如果要改变时间，肯定就是改变每次他的起点
                    if (y >= canvas.height && Math.random() > 0.99) {
                        drops[i] = 0;
                    }
                    drops[i]++; //让数组里面的值每次加一，用于上面的y轴下掉
                }
            }

            function randColor() {
                var r = Math.floor(Math.random() * 256);
                var g = Math.floor(Math.random() * 256);
                var b = Math.floor(Math.random() * 256);
                return "rgb(" + r + "," + g + "," + b + ")";
            }
            draw();
            var timer;
            var startTimer = function() {
                timer = setInterval(function() {
                    draw();
                }, 20)
            };
            var clearTimer = function() {
                clearInterval(timer);
            }
            startTimer();
            setTimeout(function() {
                $("#mom").hide(1000);
                $(".layui-tab").show(1000);
                setTimeout(function() {
                    clearTimer();
                }, 1000);

            }, 500);
            layui.use('code', function() { //加载code模块
                // layui.code();
            });
            var tableName = getQueryString("table_name");
            request(base_gateway + 'sys/field/getTemplate', {
                table_name: tableName
            }, function(ret) {
                var code = ret.code;
                if (code == 200) {

                    $("#controller").text(ret.data.controller);


                    $("#service").text(ret.data.service);

                    $("#service_impl").text(ret.data.service_impl);

                    $("#mapper").text(ret.data.mapper);

                    $("#xml").text(ret.data.xml);

                    $("#index").text(ret.data.index);

                    $("#add").text(ret.data.add);

                    $("#edit").text(ret.data.edit);
                    layui.code();
                }
            });

        });
    </script>
</body>

</html>